<template>
<BasicDrawer
    v-bind="$attrs"
    @register="registerDrawer"
    showFooter
    :title="getTitle"
    :isDetail="false"
    :width="getIsMobile ? '95%':'80%'"
    @ok="handleSubmit"
  >
    <div class="p-2 desc-wrap">
      <div v-for="i in 100" :key="i">这是订单{{ state.data }}操作日志Tab</div>
    </div>
  </BasicDrawer>
</template>

<script lang="ts" setup>
  import { reactive, computed, unref } from 'vue';
  import { useAppInject } from '@/hooks/web/useAppInject';
  import { BasicDrawer, useDrawerInner } from '@/components/Drawer';

  import { getMenuList } from '@/api/demo/system';

  const { getIsMobile } = useAppInject();
  const emit = defineEmits(['success', 'register']);
  const state = reactive({
    data:{}
  });

  const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (record) => {

    setDrawerProps({ confirmLoading: false });

    state.data = record;

  });

  const getTitle = '订单详情';

  async function handleSubmit() {
    try {
      setDrawerProps({ confirmLoading: true });
      closeDrawer();
      emit('success');
    } finally {
      setDrawerProps({ confirmLoading: false });
    }
  }
</script>

<style></style>
